package com.crawler.crawler.tool.zyu.pipeline;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

/**
 * 返回数据工具
 */
public class DataPipeline implements Pipeline {

    //返回的数据
    Object result;
    /**
     * Process extracted results.
     *
     * @param resultItems resultItems
     * @param task        task
     */
    @Override
    public void process(ResultItems resultItems, Task task) {
        result= resultItems.get("result");
    }

    /**
     * 返回数据
     * @return
     */
    public Object getObject(){
        return  result;
    }
}
